package com.bytz.modules.cms.product.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.bytz.common.system.base.service.ICrudService;
import com.bytz.modules.cms.product.entity.Product;
import com.bytz.modules.cms.product.model.ProductExcel;
import com.bytz.modules.cms.product.model.ProductModel;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

public interface IAdminProductService extends ICrudService<Product, Product> {

    /**
     * 根据经销商id和商品列表计算价格
     */
    List<ProductModel> getPriceByResellerId(String resellerId, List<Product> productList);

    /**
     * 根据经销商id、商品id获取价格
     */
    BigDecimal getPriceByResellerIdAndProductId(String resellerId, String productId);

    /**
     * 获取价格不为空的产品
     */
    List<Product> getPriceNotNull();

    /**
     * 导入商品
     */
    Boolean mergeProduct(List<ProductExcel> products);

    /**
     * 更改商品的状态
     */
    Boolean changeStatus(String id, String status);

    /**
     * 导出全部商品
     */
    void export(HttpServletResponse response) throws IOException;

    /**
     * 通过商品编码右模糊匹配
     */
    List<String> searchProductNumber(String code);

    /**
     * 根据商品编码获取一条
     */
    Product getByNumber(String code);

    /**
     * 批量修改
     * @param productList
     * @return
     */
    Boolean importChange(List<Product> productList);

    IPage<ProductModel> queryPage(String resellerId, Page<Object> page, Product product, Map<String, String[]> parameterMap) throws Exception;

    void exportResellerProducts(String resellerId, Product product, Map<String, String[]> parameterMap, HttpServletResponse response) throws Exception;
}
